/**
 * 
 */
package denaris.core.controller;

import denaris.midlet.GameScreen;

/**
 * A static controller does not alter the position of its Controllable. It does
 * however move it according to the scrollspeed to create the impression that
 * the object is floating static in the map.
 * 
 * @author stkl23
 * 
 */
public class StaticController extends AbstractController {
	private boolean doAnimate = true;

	public boolean advance() {
		controllable.move(-GameScreen.SCROLL_SPEED, 0);
		if (controllable.getX() < -20) {
			return false;
		}
		// animate in case there is a frame sequence
		if (doAnimate) {
			controllable.nextFrame();
		}

		return true;
	}

	public void setDoAnimate(boolean doAnimate) {
		this.doAnimate = doAnimate;
	}
}
